<template>
  <div>
    <Table :columns="columns" :data="data" border show-summary></Table>
    <Table
      v-if="showTotal"
      :columns="columns"
      :data="totalList"
      border
      :no-data-text="''"
      :show-header="false"
      :span-method="handleSpan"
    ></Table>
  </div>
</template>
<script>
export default {
  props: {
    showTotal: {
      default: true,
    },
    columns: {
      default: () => {
        return [];
      },
    },
    data: {
      default: () => {
        return [];
      },
    },
    totalList: {
      default: () => {
        return [];
      },
    },
  },
  data() {
    return {};
  },
  methods: {
    handleSpan({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0 && columnIndex === 1) {
        return [1, this.columns.length - 1];
      }
    },
  },
};
</script>
